﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace AutoMock.Utilities
{
	internal static class ReflectionHelper
	{
		public static ConstructorInfo GetConstructorWithMostParameters<T>()
		{
			var constructors = typeof(T).GetConstructors();

			if (constructors == null || constructors.Count() == 0)
				return null;

			var constructor = constructors.OrderByDescending(x => x.GetParameters().Count()).First();

			return constructor;
		}
	}
}
